 @SpringBootTest
class ConsumerServiceImplTest {

    @Autowired
    private ConsumerService consumerService;
    
    /**
     * 更新用户头像
     */
    @Test
    void setConsumerServiceUploadVavtar() throws IOException {
        File file = new File("C:/Users/zjs/Desktop/image/a.jpg");
        MultipartFile avatorFile = new MockMultipartFile(
                "a.jpg", //文件名
                "a.jpg", //originalName 相当于上传文件在客户机上的文件名
                ContentType.APPLICATION_OCTET_STREAM.toString(), //文件类型
                new FileInputStream(file) //文件流
        );
        R r = consumerService.updateUserAvator(avatorFile, 64);
        System.out.println(r.getSuccess());
    }
    
 }
